Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use --with-version when configuring jemalloc #77

Merged
merged 2 commits into from
Apr 1, 2024

Conversation

espindola
Copy link

@espindola espindola commented Mar 28, 2024

This also changes the metadata of the version so that jemalloc still
reports the same version as before.

Fixes #76

@espindola espindola force-pushed the correct-version branch 2 times, most recently from ddbe4b5 to a743c3e Compare March 28, 2024 14:50
Copy link
Member

@BusyJay BusyJay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@@ -155,6 +155,17 @@ fn main() {
.expect("failed to copy config file to OUT_DIR");
}

// Create a dummy .git file so that 'git describe' fails and
// configure uses the VERSION file we provide.
if let Err(e) = fs::File::create(build_dir.join(".git")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can pass the version to build script by --with-version=xxx instead.

Let's skip and delete the VERSION file in configure directory and only use version from CARGO_PKG_VERSION. So it's easier to maintain.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. I also updated the metadata part of the version so that still get the same result.

Signed-off-by: Rafael Ávila de Espíndola <[email protected]>
@espindola espindola changed the title Create a dummy .git file so that our VERSION is used Use --with-version when configuring jemalloc Mar 29, 2024
@@ -1,6 +1,6 @@
[package]
name = "tikv-jemalloc-sys"
version = "0.5.4+5.3.0-patched"
version = "0.5.4+5.3.0-0-g54eaed1d8b56b1aa528be3bdd1877e59c56fa90c"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the hash has changed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. Updated.

let out_dir = PathBuf::from(env::var_os("OUT_DIR").expect("OUT_DIR was not set"));
let src_dir = env::current_dir().expect("failed to get current directory");
let version = expect_env("CARGO_PKG_VERSION");
let metadata = version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let metadata = version
let je_version = version

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -1,6 +1,6 @@
[package]
name = "tikv-jemalloc-sys"
version = "0.5.4+5.3.0-patched"
version = "0.5.4+5.3.0-0-ge13ca993e8ccb9ba9847cc330696e02839f328f7"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version = "0.5.4+5.3.0-0-ge13ca993e8ccb9ba9847cc330696e02839f328f7"
version = "0.5.4+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

This also changes the metadata of the version so that jemalloc still
reports the same version as before.

Fixes tikv#76

Signed-off-by: Rafael Ávila de Espíndola <[email protected]>
@BusyJay BusyJay merged commit 714705e into tikv:main Apr 1, 2024
7 of 8 checks passed
@BusyJay
Copy link
Member

BusyJay commented Apr 1, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tikv_jemalloc_ctl::version can show the version of the repository using jemalloc
2 participants